// 排序分类组件
import React, { Component } from 'react';
import classNames from 'classnames';

const Tabs = (props) => {
  return (
    // 排序tab
    <div className="tabs-order">
      {props.tabs.map((item) => (
        <div
          key={item.id}
          onClick={() => props.changeTab(item.type)}
          className={classNames({ on: item.type === props.active })}
        >
          按{item.name}排序
        </div>
      ))}
    </div>
  );
};

class Tabs1 extends Component {
  render() {
    return (
      // 排序tab
      <div className="tabs-order">
        {this.props.tabs.map((item) => (
          <div
            key={item.id}
            onClick={() => this.props.changeTab(item.type)}
            className={classNames({ on: item.type === this.props.active })}
          >
            按{item.name}排序
          </div>
        ))}
      </div>
    );
  }
}

export default Tabs;
